/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package threads;

/**
 *
 * @author Bertil
 */
public class Writer implements Runnable{
    public Thread activity = new Thread(this);
    private String output;
    private long interval;
    public Writer(String out, long time){
        output = out;
        interval = time*1000;
    }

    public void run(){
        while(XThread.delay(interval)){
            System.out.println(output);
            System.out.flush();
        }
    }
}
